package com.zheng.hospital.schedule;

import com.zheng.hospital.contant.MQConstant;
import com.zheng.hospital.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class ScheduledTask {
    @Autowired
    private RabbitService rabbitService;

    @Scheduled(cron = "0/30 * * * * ?")
    public void taskPatient() {
        rabbitService.sendMessage(MQConstant.EXCHANGE_DIRECT_TASK,MQConstant.ROUTING_TASK_8,"");
    }
}
